<?php

	include('../modeles/inscriptionM.php');
	include('../class/autoload.php');
	
	$vnom = isset($_POST["nom"]) ? $_POST["nom"] : "";
	$vprenom = isset($_POST["prenom"]) ? $_POST["prenom"] : "";
	$vmail = isset($_POST["email"]) ? $_POST["email"] : "";
	$vtel = isset($_POST["tel"]) ? $_POST["tel"] : "";
	$vmdp = isset($_POST["mdp"]) ? $_POST["mdp"] : "";
	
	if($vnom == "" || $vprenom == "" || $vmail == "" || $vtel == "" || $mdp	 == "") {
		echo "Veuillez remplir tous les champs !";
	}
	
	if(isset($_POST['nom']) && isset($_POST['prenom']) && isset($_POST['email']) && isset($_POST['tel']) && isset($_POST['mdp']))
		{
			$ecole = new ecole();
			$ecole->construct($_POST['nom'],$_POST['mdp'],$_POST['email'],$_POST['tel']); 
			
			$res = inscription($ecole->nom,$ecole->mdp,$ecole->email,$ecole->tel);
			
			if($res == true)
			{
				include('vues/inscription_succes.php');
			}
			else
				{
					include('vues/inscription_fail.php');
				}
		}
	else
			{	
			 	echo "Veuillez remplir toutes les valeurs";
			}
		
?>
